import request from '@/utils/request'
// 查询角色列表
export function listRole(params) {
  return request({
    url: '/system/role/list',
    method: 'get',
    params,
  })
}
// 新增角色列表
export function addRole(data) {
  return request({
    url: '/system/role',
    method: 'post',
    data,
  })
}
// 修改角色
export function updateRole(data) {
  return request({
    url: '/system/role',
    method: 'put',
    data,
  })
}

export function getRole(roleId) {
  return request({
    url: `/system/role/${ roleId }`,
    method: 'get',
  })
}
// 删除角色
export function delRole(roleIds) {
  return request({
    url: `/system/role/${ roleIds }`,
    method: 'delete',
  })
}

export function dataScope(data) {
  return request({
    url: '/system/role/dataScope',
    method: 'put',
    data,
  })
}

export function changeRoleStatus(roleId, status) {
  return request({
    url: '/system/role/changeStatus',
    method: 'put',
    data: {
      roleId,
      status,
    },
  })
}
